package com.isoft.data.dao;

import com.isoft.data.xml.*;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author 张子识
 * @version 1.0
 */
@Mapper
public interface DfieDao {
    @Insert("INSERT AIRPORT.DFIE (SEQN,DDTM,FLID,AFID,FFID,FIDE,TEST,AWCD,FLNO,FEXD,FIMD,FLIO,FLTK,FATT, " +
            "PATT,MFID,MFFI,CFTP,CFNO,STAT,ABST,ABRS,ISTA,IAST,IARS,MSTA,MABS,MABR,MIST,MIAS,MIAR,BORT,MBOR, " +
            "TBRT,MTBR,LBDT,MLBD,POKT,MPOK,APOT,DETT,DRTT,DELT,DRLT,VIP,SFLG,PAST,GTLS,BLLS,CHLS,STLS,FLDT,LLDT,CONT,PROX) " +
            "VALUES(#{dfie.meta.seqn},#{dfie.meta.ddtm},#{dfie.dfie.flid},#{dfie.dfie.afid},#{dfie.dfie.ffid},#{dfie.dfie.fide}," +
            "#{dfie.dfie.test},#{dfie.dfie.awcd},#{dfie.dfie.flno},#{dfie.dfie.fexd},#{dfie.dfie.fimd},#{dfie.dfie.flio}," +
            "#{dfie.dfie.fltk},#{dfie.dfie.fatt},#{dfie.dfie.patt},#{dfie.dfie.mfid},#{dfie.dfie.mffi},#{dfie.dfie.cftp},#{dfie.dfie.cfno}" +
            ",#{dfie.dfie.stat},#{dfie.dfie.abst},#{dfie.dfie.abrs},#{dfie.dfie.ista},#{dfie.dfie.iast},#{dfie.dfie.iars},#{dfie.dfie.msta}," +
            "#{dfie.dfie.mabs},#{dfie.dfie.mabr},#{dfie.dfie.mist},#{dfie.dfie.mias},#{dfie.dfie.miar},#{dfie.dfie.bort},#{dfie.dfie.mbor}," +
            "#{dfie.dfie.tbrt},#{dfie.dfie.mtbr},#{dfie.dfie.lbdt},#{dfie.dfie.mlbd},#{dfie.dfie.pokt},#{dfie.dfie.mpok},#{dfie.dfie.apot}," +
            "#{dfie.dfie.dett},#{dfie.dfie.drtt},#{dfie.dfie.delt},#{dfie.dfie.drlt},#{dfie.dfie.vip},#{dfie.dfie.sflg},#{dfie.dfie.past}," +
            "#{dfie.dfie.gtls},#{dfie.dfie.blls},#{dfie.dfie.chls},#{dfie.dfie.stls},#{dfie.dfie.fldt},#{dfie.dfie.lldt},#{dfie.dfie.cont},#{dfie.dfie.prox});")
    void addDfie(@Param("dfie")Dfie dfie);
    @Insert("INSERT AIRPORT.DFIE_ARPT(SEQN,DDTM,APNO,APCD,FPTT,FETT,FRTT,FPLT,FELT,FRLT,APAT) " +
            "VALUES (#{dfie.meta.seqn},#{dfie.meta.ddtm}," +
            "#{a.apno},#{a.apcd},#{a.fptt},#{a.fett},#{a.frtt}," +
            "#{a.fplt},#{a.felt},#{a.frlt},#{a.apat});")
    void addDfieArpt(@Param("dfie") Dfie dfie, @Param("a")DfieDfltArpt arpt);
    @Insert("insert into DFIE_CKLS(SEQN,DDTM,FCES,FCEE,FCRS,FCRE,MCES,MCEE,MCRS,MCRE,FCDP,MCDP)" +
            " VALUES(#{dfie.meta.seqn},#{dfie.meta.ddtm},#{c.fces},#{c.fcee}" +
            ",#{c.fcrs},#{c.fcre},#{c.mces},#{c.mcee}" +
            ",#{c.mcrs},#{c.mcre},#{c.fcdp},#{c.mcdp})")
    void addDfieCkls(@Param("dfie") Dfie dfie, @Param("c")DfieDfltCkls ckls);
    @Insert("INSERT AIRPORT.TMCD (SEQN,DDTM,NMCD,JMCD) " +
            "VALUES(#{dfie.meta.seqn},#{dfie.meta.ddtm}," +
            "#{t.nmcd},#{t.jmcd});")
    void addDfieTmcd(@Param("dfie") Dfie dfie, @Param("t")DfieDfltTmcd tmcd);
}
